package com.time.timespace.commons.utils;

import com.github.pagehelper.PageHelper;
import com.time.timespace.commons.dto.PageRequest;
import org.springframework.util.Assert;

public class PageUtil {

    public static void doPage(PageRequest pageRequest) {
        Assert.notNull(pageRequest, "pageRequest can not be null");
        Assert.notNull(pageRequest.getPageNum(), "pageNum can not be null");
        Assert.notNull(pageRequest.getPageSize(), "pageSize can not be null");
        PageHelper.startPage(pageRequest.getPageNum(), pageRequest.getPageSize());
    }

}
